<p class="titulos-noticas-ext">Catálogo de asignatura [<?php echo count($asignatura) ?>]</p> 
<div class="info-noticas-ext"><span>Lista de todas las asignatura registradas</span></div>
<?php if ($asignatura) { ?>
     <div><a href="<?php echo site_url("asignatura/cat" . "?v=2") ?>">Vista Tabla</a></div>
     <div class="tlt_dash" style="text-align: center;">
         <div class="f_btn" style="margin-left: 650px;"><a href="<?php echo site_url("asignatura/agregar") ?>"><div class="btn_sec btn_sec_inscribe"><div class="btn_sec_wrapper"><span>Agregar</span></div></div></a></div>
     </div>
     <div class="lst_u_header"><div class="lst_u_header_el" style="padding: 5px; width: 80px; text-align: right;">Clave</div><div class="lst_u_header_el" style="padding: 5px; width: 250px;">Características</div><div class="lst_u_header_el" style="padding: 5px; width: 200px; text-align: right;">[<?php echo count($asignatura) ?>] Registros</div></div>
     <form method="POST" class="form_multiple" action="<?php echo site_url("asignatura/del/multiple" . "?v=1") ?>">
         <ul class="lst_u" id="cat_asignatura">
             <?php
             $str_html = NULL;
             foreach ($asignatura as $key => $value) {
                 $str_html .= "<li class='lst_l'>";
                 $str_html .= "<div class='lst_w' id='lst_asignatura_" . $asignatura[$key]->id() . "'>";
                 $str_html .= "<div class='lst_ind'>";
                 $str_html .= "<a href='" . site_url("asignatura/a/" . $asignatura[$key]->id()) . "' style='color:#2158A1; font-size:18px'>" . $asignatura[$key]->clave() . "</a>";
                 $str_html .= "</div>";
                 $str_html .= "<div class='lst_cnt'>";

                 $str_html .= "<div style='float: right;'>";
                 $str_html .= "<input type='checkbox' name='asignatura[]' value='" . $asignatura[$key]->id() . "'>";
                 $str_html .= "</div>";

                 $str_html .= "<div class='lst_lbl'>Nombre:</div>";
                 $str_html .= "<div class=''>";
                 $str_html .= $asignatura[$key]->nombre();
                 $str_html .= "</div>";
                 $str_html .= "<div class='lst_lbl'>Área:</div>";
                 $str_html .= "<div class=''>";
                 $str_html .= $asignatura[$key]->area();
                 $str_html .= "</div>";
                 $str_html .= "<div class='lst_lbl'>Duración:</div>";
                 $str_html .= "<div class=''>";
                 $str_html .= $asignatura[$key]->duracion();
                 $str_html .= "</div>";
                 $str_html .= "<div class='lst_lbl'>Descripción:</div>";
                 $str_html .= "<div class=''>";
                 $str_html .= $asignatura[$key]->descripcion();
                 $str_html .= "</div>";
                 $str_html .= "<div class='lst_dash' id='lst_dash_" . $asignatura[$key]->id() . "'>";
                 $str_html .= "<div class='lst_dash_w'>";
                 $str_html .= "<div class='lst_dash_el' id='lst_dash_el_ed' >";
                 $str_html .= "<a href='" . site_url("asignatura/edt/" . $asignatura[$key]->id()) . "'>Editar</a>";
                 $str_html .= "</div>";
                 $str_html .= "<div class='lst_dash_el' id='lst_dash_el_del' >";
                 $str_html .= "<a class='popup_button' href='" . site_url("asignatura/del/" . $asignatura[$key]->id()) . "'>Eliminar</a>";
                 $str_html .= "</div>";
                 $str_html .= "</div>";
                 $str_html .= "</div>";
                 $str_html .= "</li>";
             }
             echo $str_html;
             ?>
         </ul>
         <div class="lst_dash_multiple">
             <select name="accion">
                 <optgroup label="Acciones">
                     <option value="0">Seleccionar</option>
                     <option value="1" >Eliminar</option>
                 </optgroup>
             </select>
             <input class="btn_simple" type="submit" name="btn_accion" value="Ejecutar"/>
         </div>
     </form>

     <script type="text/javascript">                                                                                                 
         $(".form_multiple").submit(function(){              
             var chk =$("input:checkbox:checked").length;
             var ac = $("select").val();                                                                          
             var a =new Array()
             var i = 0;           
             $("input:checkbox:checked").each(function(){
                 a[i]= $(this).val();
                 i++;
             })                                                                      
             if(ac==0)
                 return false;    
             if(chk>0){ 
                 $.post("http://127.0.0.1/trunk/index.php/asignatura/multiple",{
                     accion: ac,
                     asignatura: a
                 }, function(data) {      
                     $.fancybox(data,{
                         'autoDimensions': false,
                         'scrolling':'no',
                         'width': 400,
                         'height': 'auto',
                         'transitionIn': 'none',
                         'transitionOut': 'none'
                     });  
                 }); 
             }                                                  
             return false;
                                                                                                
         });                                                                                                                                         
     </script>
 <?php } else { ?>
     <div class="tlt_dash" style="text-align: center;">
         <span style="margin: 0 auto;">Aún no existen registros agregue nuevos dando click en agregar</span>
         <div class="f_btn" style="margin: 30px auto;"><a href="<?php echo site_url("asignatura/agregar") ?>"><div class="btn_sec btn_sec_inscribe"><div class="btn_sec_wrapper"><span>Agregar</span></div></div></a></div>
     </div>
 <?php } ?>
     